//
//  EmptyViewController.swift
//  test-ios
//
//  Created by wyz5204 on 2023/5/27.
//

import UIKit
import RxSwift

class SimpleViewController<T : MVVMBaseViewModel>: MVVMBaseViewController<T> {
    
    
    let loadEvent = BehaviorSubject(value : false)
    
    override func viewDidLoad() {
        super.viewDidLoad()
        loadEvent.asDriver(onErrorJustReturn: false)
            .drive (onNext: { [weak self] isLoading in
                if(isLoading){
                    self?.showLoading()
                    return ;
                }
                self?.hideLoading()
            }, onDisposed: { [weak self] in
                self?.hideLoading()
            }).disposed(by: rx.disposeBag)
    }
    
}
